home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / FUZZY.ZIP / PARSER.S < prev    next >
Text File  |  1986-11-30  |  3KB  |  53 lines

  1.  
  2. -------------------------------------------------------------------------------
  3. --                                                                           --
  4. --  Library Unit:  Parser                                                    --
  5. --                                                                           --
  6. --  Author:  Bradley L. Richards                                             --
  7. --                                                                           --
  8. --     Version     Date     Notes . . .                                      --
  9. --    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -    --
  10. --       1.0    22 May 86   Initial Version                                  --
  11. --       1.1    19 Jun 86   Lotsa revisions due to Prover design             --
  12. --       2.0    20 Jun 86   Version number change only (for consistancy)     --
  13. --       2.05   13 Jul 86   Split spec and body into separate files          --
  14. --       2.1    22 Jul 86   Demonstration Version                            --
  15. --       2.2    28 Jul 86   Added parse_read.  Initial operational version   --
  16. --    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -    --
  17. --                                                                           --
  18. --  Library units used:  Data_def, listing, token, unchecked_deallocation    --
  19. --                                                                           --
  20. --  Description:  This package parses an input program, and constructs an    --
  21. --     abstract syntax tree for the program.  Start_parser and stop_parser   --
  22. --     are the initialization and clean up routines.  Parse_file parses a    --
  23. --     complete input file.  Parse_read parses a single element for the      --
  24. --     READ predicate.  Parse_request parses a user request to Fuzzy         --
  25. --     Prolog (i.e. the user assertion or query to be "proven").  Release    --
  26. --     is used to discard ASTs when they are no longer needed.  It is        --
  27. --     included in this package since this is the package which constructs   --
  28. --     the original ASTs.                                                    --
  29. --                                                                           --
  30. -------------------------------------------------------------------------------
  31. --                                                                           --
  32. --                            Package Specification                          --
  33. --                                                                           --
  34. -------------------------------------------------------------------------------
  35.  
  36. with data_def, listing, token, unchecked_deallocation;
  37. use data_def, listing, token;
  38. package parser is
  39.  
  40.     procedure parse_file( abstract_syntax_tree : out AST_ptr );
  41.     procedure parse_read( elt : out argument_ptr; eof : out boolean );
  42.     procedure parse_request( abstract_syntax_tree : out AST_ptr;
  43.                  eof : out boolean );
  44.     procedure release( tree, stop : AST_ptr);
  45.     procedure start_parser( input_file, output_file : in string );
  46.     procedure stop_parser;
  47.  
  48.   private
  49.  
  50.     procedure free_AST is new unchecked_deallocation(AST, AST_ptr);
  51.  
  52.   end parser;
  53.